package com.springcloud.demo.test.design.strategy.calculation;

import com.springcloud.demo.test.design.strategy.calculate;

/**
 * @author zhouyang
 * @Description
 * @date 2018/09/10
 */
public class FullReduce implements calculate {

    private double full;

    private double reduce;

    public FullReduce(double full, double reduce) {
        this.full = full;
        this.reduce = reduce;
    }

    @Override
    public double cal(double original) {
        double x = original / full;
        int y = (int) x;
        return original - (y * reduce);
    }

    public double getFull() {
        return full;
    }

    public void setFull(double full) {
        this.full = full;
    }

    public double getReduce() {
        return reduce;
    }

    public void setReduce(double reduce) {
        this.reduce = reduce;
    }
}
